<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./echarts.js"></script>
</head>

<body>
    <div style="width: 100%;height:800px" id="main"></div>
</body>

</html>
<script>
    let main = document.querySelector('#main')
    let obj = echarts.init(main)
    let option = {
        title: {
            text: '漏斗图'
        },
        tooltip:{ 
            trigger:'item',
            formatter:'{a}<br/>{b}:{c}%'
        },
        series:[ 
            { 
                // 漏斗图
                type:'funnel',
                data:[
                    {value:60,name:'美食'},
                    {value:40,name:'日化'},
                    {value:20,name:'数码'},
                    {value:80,name:'家电'},
                    {value:100,name:'蔬菜'},
                ]
            }
          
        ]
    }
    obj.setOption(option)
</script>